package define

import "MqttCloudProtocolServer/publiclib/helplib"

func InitInternalPath() {
	if res, _ := helplib.FileExists("config/webdebug.flag"); res {
		WebPath = "../src/web/CloudManagerWeb/"
	} else {
		WebPath = "web/CloudManagerWeb/"
	}
	if res, _ := helplib.FileExists("config/fileoff.flag"); res {
		RunLogFileLevel = 0
	} else if res, _ := helplib.FileExists("config/filefatal.flag"); res {
		RunLogFileLevel = 1
	} else if res, _ := helplib.FileExists("config/fileerr.flag"); res {
		RunLogFileLevel = 2
	} else if res, _ := helplib.FileExists("config/filewarn.flag"); res {
		RunLogFileLevel = 3
	} else if res, _ := helplib.FileExists("config/fileinfo.flag"); res {
		RunLogFileLevel = 4
	} else if res, _ := helplib.FileExists("config/filedebug.flag"); res {
		RunLogFileLevel = 5
	} else if res, _ := helplib.FileExists("config/filetrac.flag"); res {
		RunLogFileLevel = 6
	} else {
		RunLogFileLevel = 3
	}
	if res, _ := helplib.FileExists("config/consoleoff.flag"); res {
		RunLogConsoleLevel = 0
	} else if res, _ := helplib.FileExists("config/consolefatal.flag"); res {
		RunLogConsoleLevel = 1
	} else if res, _ := helplib.FileExists("config/consoleerr.flag"); res {
		RunLogConsoleLevel = 2
	} else if res, _ := helplib.FileExists("config/consolewarn.flag"); res {
		RunLogConsoleLevel = 3
	} else if res, _ := helplib.FileExists("config/consoleinfo.flag"); res {
		RunLogConsoleLevel = 4
	} else if res, _ := helplib.FileExists("config/consoledebug.flag"); res {
		RunLogConsoleLevel = 5
	} else if res, _ := helplib.FileExists("config/consoletrac.flag"); res {
		RunLogConsoleLevel = 6
	} else {
		RunLogConsoleLevel = 0
	}
}

const (
	//ConfigPath 配置文件路径
	ConfigPath = "config/"
	//LogPath log文件路径
	LogPath = "log/"
	//EmqxPath Emqx文件路径
	EmqxPath = "emqx/bin/"
)

var (
	//运行时文件输出信息等级
	RunLogFileLevel = 0
	//运行时控制台输出信息等级
	RunLogConsoleLevel = 0
	//WebPath web路径
	WebPath = ""
)

/*const (
	//WebPath web路径
	WebPath = "web/CloudManagerWeb/"
	//ConfigPath 配置文件路径
	ConfigPath = "config/"
	//LogPath log文件路径
	LogPath = "log/"
	//EmqxPath Emqx文件路径
	EmqxPath = "emqx/bin/"
)*/
